/**
 * @ author: 汪孟苹
 */
define(["jquery","bbcare","oms_config/root","fu/app/comm/comm",
    "scprit/followup/app/datatable/datatable.ui.js",
    "scprit/followup/app/lostFollowupManager/lostFollowupRecord.servers.js",
    "scprit/followup/app/lostFollowupManager/lostFollowupRecord.ui.js"],
    function ($,$bb,$root,$comm,$datatableUi,$lostFollowupRecordServers,$lostFollowupRecordUi) {
    var lostFollowupRecord = {};

    var URL = $bb.baseUrl("followup");
    /**
     * 请求队列成功后的回调函数
     */
    var ajaxQueuesCallBack = function(rows){
        $comm.selectQueue({
            "id": "queue", 
            "list": rows
        });
    }

    lostFollowupRecord.init = function(){
        $lostFollowupRecordServers.ajaxQueues(ajaxQueuesCallBack);    // 加载队列
        $datatableUi.init({
            "id": "lostfollowup",
            "options": $lostFollowupRecordServers.getOptions()
        });  
        /* 列的显示与隐藏 */
        var config = $root.init();
        if(!config.dom.lostFollowupRecordAge){
            $datatableUi.table.api().columns('.age').visible(false);
        }
        if(!config.dom.lostFollowupRecordGestation){
            $datatableUi.table.api().columns('.pregnancyWeek').visible(false);
        }
        if(!config.dom.lostFollowupRecordBirthday){
            $datatableUi.table.api().columns('.birthday').visible(false);
        }
    }

    return lostFollowupRecord;
});